package com.xz.stu.server.job;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

@Configuration
public class TaskSchedulerConfig {

    @Bean
    public ThreadPoolTaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
        scheduler.setPoolSize(100); // 设置线程池大小，根据实际需求调整
        scheduler.setThreadNamePrefix("DynamicTask-"); // 设置线程名称前缀
        return scheduler;
    }
}
